
import { contextBridge,screen,ipcMain,BrowserWindow,ipcRenderer } from 'electron';
contextBridge.exposeInMainWorld('versions', {
  node: () => process.versions.node,
  chrome: () => process.versions.chrome,
  electron: () => process.versions.electron
  // we can also expose variables, not just functions
})




export const ElectronAPI = {
    getProfile: () => ipcRenderer.invoke('auth:get-profile'),
    logOut: () => ipcRenderer.send('auth:log-out'),
    getPrivateData: () => ipcRenderer.invoke('api:get-private-data'),
};

contextBridge.exposeInMainWorld('electronAPI', ElectronAPI);
export const UAPI = {
    hello:()=>"hello ui",
    dragMove: (can:boolean)=>ipcRenderer.invoke("window-move-open",can),
};
contextBridge.exposeInMainWorld('ui',UAPI)
window.addEventListener('DOMContentLoaded', () => {
    const el = document.getElementById('rootTuotu')
    if(el){
        el.addEventListener('mouseenter', () => {
            ipcRenderer.send('set-ignore-mouse-events', false)
        })
        el.addEventListener('mouseleave', () => {
            ipcRenderer.send('set-ignore-mouse-events', true, { forward: true })
        })
    }

})
// contextBridge.exposeInMainWorld('ui', {
//     // dragMove: (can:boolean)=>ipcRenderer.invoke("window-move-open",can),
//     // ipcRenderer:ipcRenderer
//     hello:()=>"hello ui"
//     // we can also expose variables, not just functions
// })
